package com.example.demo2_review.design_pattern.structural_patterns.decorator_pattern;

/**
 * @Author zwp14
 * @create 2024/6/25 0:29
 * @description 实现类
 */
public class RedShapeDecorator extends ShapeDecorator{

    /**
     * 有参构造
     * @param decoratedShape 装饰器
     */
    public RedShapeDecorator(Shape decoratedShape) {
        super(decoratedShape);
    }

    @Override
    public void draw() {
        super.draw();
        setRedBorder(new Rectangle());
    }

    /**
     * 添加装饰
     * @param decoratedShape 为绘画者新增能力
     */
    private void setRedBorder(Shape decoratedShape) {
        System.out.println("Border Color: Red");
    }
}
